﻿@model TCC.CMFlow.Models.PerfilAcessoConfiguracao

@{
    ViewBag.Title = "Configurar Permissões";
    //Layout = "~/Views/Shared/_Layout.cshtml";
}

<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h4 class="modal-title" id="myModalLabel">@ViewBag.Title</h4>
</div>

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()

    <div class="modal-body">
        <div class="form-horizontal">
            @Html.ValidationSummary(true)
            @Html.HiddenFor(model => model.PerfilAcessoID)
            @Html.HiddenFor(model => model.ModuloSistemaID)

            <div class="form-group">
                @Html.LabelFor(model => model.Permissoes, "Permissões", new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    <div class="multiselect-field">
                        @Html.ListBox("PermissaoList", ViewBag.PerfilAcessoPermissoes as MultiSelectList, new { @class = "chosen-select", data_placeholder = "Selecione as Permissões..." })
                    </div>
                    @Html.ValidationMessageFor(model => model.ModuloSistemaID)
                    @Html.ValidationMessageFor(model => model.PerfilAcessoID)
                </div>
            </div>
        </div>
    </div>
            
    <div class="modal-footer">
        <button class="btn" data-dismiss="modal">Cancelar</button>
        <input type="submit" value="Confirmar" class="btn btn-primary" />
    </div>
}

<script type="text/javascript">
    var config = {
        '.chosen-select': {},
        '.chosen-select-deselect': { allow_single_deselect: true },
        '.chosen-select-no-single': { disable_search_threshold: 10 },
        '.chosen-select-no-results': { no_results_text: 'Oops, nothing found!' },
        '.chosen-select-width': { width: "95%" }
    }
    for (var selector in config) {
        $(selector).chosen(config[selector]);
    }
</script>








